{% extends "admin/common_base.html" %}

{% block main %}

    <div class="main">
        <div class="body container">
            <div class="typecho-page-title">
                <h2>基本设置</h2>
            </div>
            <div class="row typecho-page-main" role="form">
                <div class="col-mb-12 col-tb-8 col-tb-offset-2">
                    <form action="http://www.typecho.local/index.php/action/options-general?_=997d77a6b23315b2ac8362e02005a23e" method="post"
                        enctype="application/x-www-form-urlencoded">
                        <ul class="typecho-option" id="typecho-option-item-title-0">
                            <li>
                                <label class="typecho-label" for="title-0-1">
                                    站点名称</label>
                                <input id="title-0-1" name="title" type="text" class="w-100" value="Hello World" />
                                <p class="description">
                                    站点的名称将显示在网页的标题处.</p>
                            </li>
                        </ul>
                        <ul class="typecho-option" id="typecho-option-item-siteUrl-1">
                            <li>
                                <label class="typecho-label" for="siteUrl-0-2">
                                    站点地址</label>
                                <input id="siteUrl-0-2" name="siteUrl" type="text" class="w-100 mono" value="http://www.typecho.local" />
                                <p class="description">
                                    站点地址主要用于生成内容的永久链接.</p>
                            </li>
                        </ul>
                        <ul class="typecho-option" id="typecho-option-item-title-0">
                            <li>
                                <label class="typecho-label" for="title-0-1">
                                    站点 LOGO 地址</label>
                                <input id="title-0-1" name="logoUrl" type="text" class="w-100" value="" />
                                <p class="description">
                                    在这里填入一个图片 URL 地址, 以在网站标题前加上一个 LOGO .</p>
                            </li>
                        </ul>
                        <ul class="typecho-option" id="typecho-option-item-description-2">
                            <li>
                                <label class="typecho-label" for="description-0-3">
                                    站点描述</label>
                                <input id="description-0-3" name="description" type="text" class="text" value="Just So So ..." />
                                <p class="description">
                                    站点描述将显示在网页代码的头部.</p>
                            </li>
                        </ul>
                        <ul class="typecho-option" id="typecho-option-item-keywords-3">
                            <li>
                                <label class="typecho-label" for="keywords-0-4">
                                    关键词</label>
                                <input id="keywords-0-4" name="keywords" type="text" class="text" value="typecho,php,blog" />
                                <p class="description">
                                    请以半角逗号 "," 分割多个关键字.</p>
                            </li>
                        </ul>
                        
                        <ul class="typecho-option" id="typecho-option-item-attachmentTypes-7">
                            <li>
                                <label class="typecho-label">
                                    允许上传的文件类型</label>
                                <span class="multiline">
                                    <input name="attachmentTypes[]" type="checkbox" value="@image@" id="attachmentTypes-image" checked="true" />
                                    <label for="attachmentTypes-image">
                                        图片文件
                                        <code>(gif jpg jpeg png tiff bmp)</code>
                                    </label>
                                </span>
                                <span class="multiline">
                                    <input name="attachmentTypes[]" type="checkbox" value="@media@" id="attachmentTypes-media" />
                                    <label for="attachmentTypes-media">
                                        多媒体文件
                                        <code>(mp3 wmv wma rmvb rm avi flv)</code>
                                    </label>
                                </span>
                                <span class="multiline">
                                    <input name="attachmentTypes[]" type="checkbox" value="@doc@" id="attachmentTypes-doc" />
                                    <label for="attachmentTypes-doc">
                                        常用档案文件
                                        <code>(txt doc docx xls xlsx ppt pptx zip rar pdf)</code>
                                    </label>
                                </span>
                                <span class="multiline">
                                    <input name="attachmentTypes[]" type="checkbox" value="@other@" id="attachmentTypes-other" />
                                    <label for="attachmentTypes-other">
                                        其他格式
                                        <input type="text" class="w-50 text-s mono" name="attachmentTypesOther" value=""
                                        />
                                    </label>
                                </span>
                                <p class="description">
                                    用逗号 "," 将后缀名隔开, 例如:
                                    <code>cpp, h, mak</code>
                                </p>
                            </li>
                        </ul>
                        <ul class="typecho-option typecho-option-submit" id="typecho-option-item-submit-8">
                            <li>
                                <button type="submit" class="btn primary">
                                    保存设置</button>
                            </li>
                        </ul>
                    </form>
                </div>
            </div>
        </div>
    </div>

    {% endblock %}
    {% block footer %}
    <script>
        (function () {
            $(document).ready(function () {
                var error = $('.typecho-option .error:first');

                if (error.length > 0) {
                    $('html,body').scrollTop(error.parents('.typecho-option').offset().top);
                }

                $('form').submit(function () {
                    if (this.submitted) {
                        return false;
                    } else {
                        this.submitted = true;
                    }
                });

                $('label input[type=text]').click(function (e) {
                    var check = $('#' + $(this).parents('label').attr('for'));
                    check.prop('checked', true);
                    return false;
                });
            });
        })();
    </script>
{% endblock %}